#include "Client.hpp"

#include <stdlib.h>
/**
 * Client
 * = player ingame
 **/
Client::Client(int sfd)
{
	this->sfd=sfd;
	this->login=new char[255];
	*this->login=0;
	this->map=new char[255];
	*this->map=0;
	this->speed.x=this->speed.y=0.;
	this->position.x=this->position.y=0.;

	// epoll stuff
	this->epollEvent.data.fd=sfd;
	this->epollEvent.events=EPOLLIN;
}
Client::Client()
{
	this->sfd=-1;
	this->login=new char[255];
	*this->login=0;
	this->map=new char[255];
	*this->map=0;
	this->speed.x=this->speed.y=0.;
	this->position.x=this->position.y=0.;

	// epoll stuff
	this->epollEvent.data.fd=sfd;
	this->epollEvent.events=EPOLLIN;
}
Client::~Client()
{
	free(login);
	free(map);
}
void Client::setPosition(double x,double y)
{
	this->position.x=x;
	this->position.y=y;
}
void Client::setSpeed(double x, double y)
{
	this->speed.x=x;
	this->speed.y=y;
}
void Client::addSend(char* send)
{
	this->sendList.add(send);
}
void Client::clearSendList()
{
	this->sendList.clear();
}

